<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>5、函数式组件</title>
</head>
<body>
    <div id="test"></div>

    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
    <script type="text/babel">
        // 函数式组件，注意首字母大写
        function Demo(){
            return <h2>我是用函数定义的组件(适用于简单组件的定义)</h2>
        }

        // 渲染组件到界面
        ReactDOM.render(<Demo/>, document.getElementById('test'))
    </script>
</body>
</html>